/**
 *  @file friendlyShip.h
 *
 *  @date 16-nov-2009
 *  @author Ives van der Flaas
 */

#ifndef FRIENDLYSHIP_H_
#define FRIENDLYSHIP_H_

#include <tr1/memory>
#include <iostream>
#include "ship.h"
#include "vector2.h"
#include "scoreKeeper.h"

namespace si
{

/**
 * A ship that can shoot EnemyShips. This is either controlled by
 * a human player or (to be implemented?) by the computer too...
 */
class FriendlyShip: public si::Ship
{
public:
	/**
	 * Ctor
	 * @return None
	 */
	FriendlyShip();
	virtual ~FriendlyShip();

	/**
	 * Resets ship to original position, health and removes all bullets.
	 */
	virtual void reset();

	/**
	 * Updates the ship's position and representation
	 * @param time
	 */
	virtual void update(double time);

	/**
	 * Is called when bullet "whichBullet" hits target
	 * @param whichBullet
	 */
	virtual void bulletHit(int whichBullet);

	/**
	 * Is called when the ship fires.
	 */
	virtual void fire();

	/**
	 * Is called when this ship is hit
	 * @param hitAmount Amount of damage done
	 */
	virtual void takeHit(int hitAmount);

	/**
	 * Is called at the beginning of new games ed, when the score needs to be reset
	 */
	void resetScore() { fScore = 0; }

	/**
	 * Draw yourself, your bullets and your score.
	 */
	virtual void draw() const;

	int getScore() const { return fScore; }


protected:
	Vector2 fStartPosition;
	int fScore;
	std::tr1::shared_ptr<ScoreKeeper> fScoreKeeper;
};

}

#endif /* FRIENDLYSHIP_H_ */
